import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import( '../views/LayoutView.vue' ),
    children: [
      {
        path: '/layout',
        redirect: '/layout/qianduan'
      },
      {
        path: '/layout/qianduan',
        name: 'qianduan',
        component: () => import('../views/QianduanView.vue')
      },
      {
        path: '/layout/shijue',
        name: 'shijue',
        component: () => import('../views/ShijueView.vue')
      },
      {
        path: '/layout/quanzhan',
        name: 'quanzhan',
        component: () => import('../views/QuanzhanView.vue')
      },
      {
        path: '/layout/rengong',
        name: 'rengong',
        component: () => import('../views/RengongView.vue')
      },
      {
        path: '/layout/xitong',
        name: 'xitong',
        component: () => import('../views/XiTongView.vue')
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
